package com.itqf.controller;

import com.itqf.client.TbItemFeignClient;
import com.itqf.entity.TbItem;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/12/23
 * @Time: 上午11:01
 */
@RestController
public class MyController {


    @Resource
    private TbItemFeignClient client;



    @RequestMapping(value = "/find",produces = "application/json")
    public   TbItem  find(){

        TbItem tbItem = client.findAll();

        return tbItem;
    }


    @RequestMapping(value = "/findById/{id}",produces = "application/json")
    public   TbItem  findById(@PathVariable("id") int id){

        TbItem tbItem = client.findById(1);

        return tbItem;
    }


}
